<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>pcarec.m</title>
<link rel="stylesheet" type="text/css" href="../../../m-syntax.css">
</head>
<body>
<code>
<span class=defun_kw>function</span>&nbsp;<span class=defun_out>Y&nbsp;</span>=&nbsp;<span class=defun_name>pcarec</span>(<span class=defun_in>X,model</span>)<br>
<span class=h1>%&nbsp;PCAREC&nbsp;Computes&nbsp;reconstructed&nbsp;vector&nbsp;after&nbsp;PCA&nbsp;projection.</span><br>
<span class=help>%&nbsp;</span><br>
<span class=help>%&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>%&nbsp;&nbsp;Y&nbsp;=&nbsp;pcarec(X,model)</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>%&nbsp;&nbsp;The&nbsp;input&nbsp;vectorts&nbsp;X&nbsp;are&nbsp;projected&nbsp;onto&nbsp;Z&nbsp;using&nbsp;linear&nbsp;</span><br>
<span class=help>%&nbsp;&nbsp;projection&nbsp;trained&nbsp;by&nbsp;the&nbsp;Principal&nbsp;Component&nbsp;Analysis&nbsp;(PCA).&nbsp;</span><br>
<span class=help>%&nbsp;&nbsp;The&nbsp;vectors&nbsp;Y&nbsp;are&nbsp;computed&nbsp;from&nbsp;Z&nbsp;as&nbsp;a&nbsp;reconstruction&nbsp;of&nbsp;</span><br>
<span class=help>%&nbsp;&nbsp;the&nbsp;original&nbsp;vectors&nbsp;X:</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PCA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reconstr</span><br>
<span class=help>%&nbsp;&nbsp;&nbsp;&nbsp;X&nbsp;&nbsp;---&gt;&nbsp;&nbsp;Z&nbsp;&nbsp;&nbsp;---&gt;&nbsp;&nbsp;&nbsp;Y</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>%&nbsp;&nbsp;X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Input&nbsp;vectors.</span><br>
<span class=help>%&nbsp;&nbsp;model&nbsp;[struct]&nbsp;Linear&nbsp;projection&nbsp;trained&nbsp;by&nbsp;PCA.&nbsp;</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>%&nbsp;&nbsp;Y&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Reconstructed&nbsp;vectors.</span><br>
<span class=help>%</span><br>
<span class=help>%&nbsp;See&nbsp;also&nbsp;</span><br>
<span class=help>%&nbsp;&nbsp;LINPROJ,&nbsp;PCA,&nbsp;KPCAREC.</span><br>
<span class=help>%</span><br>
<hr>
<span class=help1>%&nbsp;<span class=help1_field>About:</span>&nbsp;Statistical&nbsp;Pattern&nbsp;Recognition&nbsp;Toolbox</span><br>
<span class=help1>%&nbsp;(C)&nbsp;1999-2003,&nbsp;Written&nbsp;by&nbsp;Vojtech&nbsp;Franc&nbsp;and&nbsp;Vaclav&nbsp;Hlavac</span><br>
<span class=help1>%&nbsp;&lt;a&nbsp;href="http://www.cvut.cz"&gt;Czech&nbsp;Technical&nbsp;University&nbsp;Prague&lt;/a&gt;</span><br>
<span class=help1>%&nbsp;&lt;a&nbsp;href="http://www.feld.cvut.cz"&gt;Faculty&nbsp;of&nbsp;Electrical&nbsp;Engineering&lt;/a&gt;</span><br>
<span class=help1>%&nbsp;&lt;a&nbsp;href="http://cmp.felk.cvut.cz"&gt;Center&nbsp;for&nbsp;Machine&nbsp;Perception&lt;/a&gt;</span><br>
<br>
<span class=help1>%&nbsp;<span class=help1_field>Modifications:</span></span><br>
<span class=help1>%&nbsp;25-may-2004,&nbsp;VF</span><br>
<span class=help1>%&nbsp;5-may-2004,&nbsp;VF</span><br>
<span class=help1>%&nbsp;22-apr-2004,&nbsp;VF</span><br>
<span class=help1>%&nbsp;17-mar-2004,&nbsp;VF,&nbsp;created.</span><br>
<br>
<hr>
[dim,num_data]&nbsp;=&nbsp;size(X);<br>
<br>
Y&nbsp;=&nbsp;model.W*linproj(X,model)&nbsp;+&nbsp;model.mean_X*ones(1,num_data);<br>
<br>
<span class=jump>return</span>;&nbsp;&nbsp;<br>
<span class=comment>%&nbsp;EOF&nbsp;&nbsp;</span><br>
</code>
